import {Toast} from "vant";

export let open = function (params = {}) {

  Toast.loading({
    mask: false,
    duration: 0,
    className: 'page-loading' + (params.message ? ' is-message' : ''),
    onClose: function () {
      Toast.allowMultiple(true);
    },
    ...params
  });
};

export let close = function () {
  Toast.clear();
};

export default {
  open,
  close
}
